--------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\wb614536\Downloads\replication\replication\code\../outputs/05_Validity_log.txt
  log type:  text
 opened on:  25 Jun 2026, 12:54:25
r; t=0.00 12:54:25

. 
. include "_OutcomeLabels.do"

. /*==============================================================================
>   _OutcomeLabels.do  (helper, not run on its own)
> 
>   Defines polished, publication-ready labels for every outcome that appears
>   in figures and tables. Labels use the macro pattern `lbl_<outcome>`.
>   Visualization do files `include` this file and reference `lbl_<outcome>`
>   to print a pretty label rather than the raw Stata variable name.
> 
>   Categorical/binary indicators are suffixed with "[=1]" so the reader sees
>   what a unit change means; counts and continuous variables get explicit
>   units; standardized indices are flagged "(SD)".
> 
>   Sandra Rozo
> ==============================================================================*/
. 
. * ---- Economic well-being -----------------------------------------------------
. local lbl_jeea_index_wellbeing  "Well-being index (SD)"
r; t=0.00 12:54:25

. local lbl_labour_income         "Log monthly labor income"
r; t=0.00 12:54:25

. local lbl_gasto_capita          "Log per-capita HH consumption"
r; t=0.00 12:54:25

. local lbl_income_maxhh          "Log HH-max labor income"
r; t=0.00 12:54:25

. local lbl_employed              "Employed [=1]"
r; t=0.00 12:54:25

. 
. * ---- Labor ------------------------------------------------------------------
. local lbl_jeea_index_labor      "Labor index (SD)"
r; t=0.00 12:54:25

. local lbl_formal                "Formal employment [=1]"
r; t=0.00 12:54:25

. local lbl_hora_semana           "Log weekly hours (salaried)"
r; t=0.00 12:54:25

. 
. * ---- Services and rights ----------------------------------------------------
. local lbl_jeea_index_services   "Services index (SD)"
r; t=0.00 12:54:25

. local lbl_sisben                "SISBEN registration [=1]"
r; t=0.00 12:54:25

. local lbl_subs                  "Subsidized health [=1]"
r; t=0.00 12:54:25

. local lbl_bank                  "Savings account [=1]"
r; t=0.00 12:54:25

. local lbl_has_bank_account      "Bank account (incl. savings) [=1]"
r; t=0.00 12:54:25

. local lbl_govtr                 "Govt. transfers [=1]"
r; t=0.00 12:54:25

. 
. * ---- Health -----------------------------------------------------------------
. local lbl_health_pca            "Health PCA index (SD)"
r; t=0.00 12:54:25

. local lbl_anx_depr              "Severe anxiety/depression [=1]"
r; t=0.00 12:54:25

. local lbl_any_anx_depr          "Any anxiety/depression [=1]"
r; t=0.00 12:54:25

. local lbl_vas_score             "Self-rated health (0-100)"
r; t=0.00 12:54:25

. local lbl_phys_problem          "Physical health problem [=1]"
r; t=0.00 12:54:25

. local lbl_chronic_illness       "Chronic illness [=1]"
r; t=0.00 12:54:25

. local lbl_mh_index              "Mental-health composite (SD)"
r; t=0.00 12:54:25

. local lbl_life_satisfaction     "Life satisfaction (0-10)"
r; t=0.00 12:54:25

. local lbl_hi5_inv               "EQ-5D anx/depr (5-low to 1-high)"
r; t=0.00 12:54:25

. 
. * ---- Food security ----------------------------------------------------------
. local lbl_index_food            "Food security index (SD)"
r; t=0.00 12:54:25

. local lbl_skip_meals            "Skipped meals last month [=1]"
r; t=0.00 12:54:25

. local lbl_went_without_food     "Went without food [=1]"
r; t=0.00 12:54:25

. local lbl_protein_days          "Days w/ protein (last week)"
r; t=0.00 12:54:25

. local lbl_food_insecure_seek    "Sought food assistance [=1]"
r; t=0.00 12:54:25

. 
. * ---- Housing ----------------------------------------------------------------
. local lbl_index_housing         "Housing quality index (SD)"
r; t=0.00 12:54:25

. local lbl_adequate_housing      "Adequate housing [=1]"
r; t=0.00 12:54:25

. local lbl_has_electricity       "Has electricity [=1]"
r; t=0.00 12:54:25

. local lbl_has_water             "Has running water [=1]"
r; t=0.00 12:54:25

. local lbl_has_sewage            "Has sewage [=1]"
r; t=0.00 12:54:25

. 
. * ---- Integration ------------------------------------------------------------
. local lbl_index_integration     "Integration index (SD)"
r; t=0.00 12:54:25

. local lbl_belonging             "Sense of belonging (1-4)"
r; t=0.00 12:54:25

. local lbl_feel_integrated       "Feels integrated (1-4)"
r; t=0.00 12:54:25

. local lbl_trust_col             "Trust in Colombians (out-group, 1-5)"
r; t=0.00 12:54:25

. local lbl_trust_ven             "Trust in Venezuelans (in-group, 1-5)"
r; t=0.00 12:54:25

. local lbl_general_trust         "General trust in people (1-5)"
r; t=0.00 12:54:25

. local lbl_venezuelans_help_me   "Venezuelans help me (1-5)"
r; t=0.00 12:54:25

. local lbl_trust_index           "Prosocial behaviors composite (SD)"
r; t=0.00 12:54:25

. local lbl_col_friends           "Number Colombian friends"
r; t=0.00 12:54:25

. local lbl_community_org         "Belongs to community org [=1]"
r; t=0.00 12:54:25

. local lbl_connection_colombia   "Strong connection to Colombia [=1]"
r; t=0.00 12:54:25

. local lbl_colombians_help_me    "Colombians help me (1-5)"
r; t=0.00 12:54:25

. local lbl_count_on_col          "Can count on Colombians (1-5)"
r; t=0.00 12:54:25

. 
. * ---- Discrimination ---------------------------------------------------------
. local lbl_index_discrim         "Discrimination index (SD)"
r; t=0.00 12:54:25

. local lbl_discrim_ever          "Ever discriminated against [=1]"
r; t=0.00 12:54:25

. local lbl_discrim_freq          "Discrimination frequency (1-5)"
r; t=0.00 12:54:25

. local lbl_filed_complaint       "Filed discrimination complaint [=1]"
r; t=0.00 12:54:25

. 
. * ---- Migration intentions ---------------------------------------------------
. local lbl_intend_stay           "Intends to stay in Colombia [=1]"
r; t=0.00 12:54:25

. local lbl_plan_stay_5yr         "Plans to stay 5+ years [=1]"
r; t=0.00 12:54:25

. local lbl_considered_return_ven "Considered returning to Venezuela [=1]"
r; t=0.00 12:54:25

. 
. * ---- COVID -----------------------------------------------------------------
. local lbl_index_covid           "COVID resilience index (SD)"
r; t=0.00 12:54:25

. local lbl_covid_income_down     "Income fell during COVID [=1]"
r; t=0.00 12:54:25

. local lbl_covid_eviction        "Faced eviction during COVID [=1]"
r; t=0.00 12:54:25

. local lbl_covid_received_aid    "Received COVID aid [=1]"
r; t=0.00 12:54:25

. 
. * ---- Education -------------------------------------------------------------
. local lbl_currently_studying    "Currently studying [=1]"
r; t=0.00 12:54:25

. local lbl_currently_enrolled    "Currently enrolled in school [=1]"
r; t=0.00 12:54:25

. local lbl_degree_validated      "Foreign degree validated [=1]"
r; t=0.00 12:54:25

. 
. * ---- Children --------------------------------------------------------------
. local lbl_child_skip_meals      "Child skipped meals [=1]"
r; t=0.00 12:54:25

. local lbl_child_vaccinated      "Child vaccinated [=1]"
r; t=0.00 12:54:25

. local lbl_child_worked          "Child worked [=1]"
r; t=0.00 12:54:25

. 
. * ---- Remittances -----------------------------------------------------------
. local lbl_index_remit           "Remittances index (SD)"
r; t=0.00 12:54:25

. local lbl_remit_now             "Sends remittances now [=1]"
r; t=0.00 12:54:25

. local lbl_remit_to_parents      "Remits to parents [=1]"
r; t=0.00 12:54:25

. 
. * ---- Financial access and digital ------------------------------------------
. local lbl_index_fin_access      "Financial access index (SD)"
r; t=0.00 12:54:25

. local lbl_index_digital         "Digital access index (SD)"
r; t=0.00 12:54:25

. local lbl_has_savings_account   "Has savings account [=1]"
r; t=0.00 12:54:25

. local lbl_has_mobile_money      "Has mobile money [=1]"
r; t=0.00 12:54:25

. local lbl_has_smartphone        "Has smartphone [=1]"
r; t=0.00 12:54:25

. local lbl_has_internet          "Has internet [=1]"
r; t=0.00 12:54:25

. local lbl_apps_whatsapp         "Uses WhatsApp [=1]"
r; t=0.00 12:54:25

. 
. * ============================================================================
. *  PREDETERMINED COVARIATES (used for balance tests and as RD controls)
. * ============================================================================
. 
. * ---- Demographics ----------------------------------------------------------
. local lbl_female                "Female [=1]"
r; t=0.00 12:54:25

. local lbl_age_panel             "Age (years)"
r; t=0.00 12:54:25

. local lbl_yrseduc               "Years of education"
r; t=0.00 12:54:25

. local lbl_time_col              "Years in Colombia"
r; t=0.00 12:54:25

. local lbl_child_venez           "Has child born in Venezuela [=1]"
r; t=0.00 12:54:25

. 
. * ---- Pre-migration economic conditions (in Venezuela) ----------------------
. local lbl_jobopp                "Had a job offer in Colombia [=1]"
r; t=0.00 12:54:25

. local lbl_labven                "Worked in Venezuela [=1]"
r; t=0.00 12:54:25

. local lbl_typeworkven1          "Worked in agric./manual (VZ) [=1]"
r; t=0.00 12:54:25

. local lbl_typeworkven2          "Worked in services (VZ) [=1]"
r; t=0.00 12:54:25

. local lbl_typeworkven3          "Worked in skilled occ. (VZ) [=1]"
r; t=0.00 12:54:25

. local lbl_written_cont          "Had written contract (VZ) [=1]"
r; t=0.00 12:54:25

. local lbl_average               "Avg. days worked / week (VZ)"
r; t=0.00 12:54:25

. local lbl_smartven              "Owned smartphone in VZ [=1]"
r; t=0.00 12:54:25

. local lbl_owner                 "Homeowner in VZ [=1]"
r; t=0.00 12:54:25

. local lbl_electven              "Had electricity in VZ [=1]"
r; t=0.00 12:54:25

. local lbl_waterven              "Had running water in VZ [=1]"
r; t=0.00 12:54:25

. local lbl_sewageven             "Had sewage in VZ [=1]"
r; t=0.00 12:54:25

. 
. * ---- Family / migration network -------------------------------------------
. local lbl_hhven_parents         "Parents born in VZ [=1]"
r; t=0.00 12:54:25

. local lbl_hhven_spouse          "Spouse born in VZ [=1]"
r; t=0.00 12:54:25

. local lbl_hhven_other           "Other HH members born in VZ [=1]"
r; t=0.00 12:54:25

. local lbl_healthmig             "Healthy at migration [=1]"
r; t=0.00 12:54:25

. local lbl_frdfam                "Network in Colombia [=1]"
r; t=0.00 12:54:25

. r; t=0.01 12:54:25

. 
. di "=================================================================="
==================================================================
r; t=0.00 12:54:25

. di "  05_Validity.do"
  05_Validity.do
r; t=0.00 12:54:25

. di "  Date: $S_DATE  Time: $S_TIME"
  Date: 25 Jun 2026  Time: 12:54:25
r; t=0.00 12:54:25

. di "=================================================================="
==================================================================
r; t=0.00 12:54:25

. 
. use "$clean/PEP_Analysis_Sample.dta", clear
(PEP analysis sample (JEEA-style + extended outcome indices))
r; t=0.09 12:54:26

. 
. /*==============================================================================
>   PART 1: APPLY JEEA-STYLE SAMPLE RESTRICTIONS
> ==============================================================================*/
. 
. local jeea_controls hhven_spouse hhven_other jobopp labven ///
>                     typeworkven1 typeworkven2 typeworkven3 ///
>                     written_cont average yrseduc healthmig frdfam ///
>                     smartven owner electven waterven sewageven female ///
>                     age_panel child_venez time_col
r; t=0.00 12:54:26

. 
. gen sample_roster = .
(13,580 missing values generated)
r; t=0.00 12:54:26

. qui reg trt_hh `jeea_controls'
r; t=2.27 12:54:28

. replace sample_roster = e(sample)
(13,580 real changes made)
r; t=0.00 12:54:28

. replace sample_roster = 0 if gasto_capita == . & trt_hh != .
(119 real changes made)
r; t=0.00 12:54:28

. replace sample_roster = 0 if employed == . & trt_hh != .
(88 real changes made)
r; t=0.00 12:54:28

. replace sample_roster = 0 if hora_semana == . & trt_hh != . & asalariado_num == 1
(64 real changes made)
r; t=0.00 12:54:28

. replace sample_roster = 0 if anx_depr == .
(2 real changes made)
r; t=0.00 12:54:28

. replace sample_roster = 0 if health_pca == .
(8 real changes made)
r; t=0.00 12:54:28

. bysort family_id: egen sample_reg = max(sample_roster)
r; t=0.02 12:54:28

. keep if (orden == 1 | orden == 2) & sample_reg == 1
(6,451 observations deleted)
r; t=0.02 12:54:28

. 
. di ""

r; t=0.00 12:54:28

. di "  JEEA analysis sample (orden in {1,2}, sample_reg==1):"
  JEEA analysis sample (orden in {1,2}, sample_reg==1):
r; t=0.00 12:54:28

. tab wave_num, m

       Survey wave |      Freq.     Percent        Cum.
-------------------+-----------------------------------
 Wave 1 (Baseline) |      4,328       60.71       60.71
Wave 2 (Follow-up) |      2,801       39.29      100.00
-------------------+-----------------------------------
             Total |      7,129      100.00
r; t=0.00 12:54:28

. 
. /*==============================================================================
>   PART 2: McCRARY DENSITY TEST
> ==============================================================================*/
. 
. di ""

r; t=0.00 12:54:28

. di "=================================================================="
==================================================================
r; t=0.00 12:54:28

. di "  McCrary density test (rddensity, c=0)"
  McCrary density test (rddensity, c=0)
r; t=0.00 12:54:28

. di "=================================================================="
==================================================================
r; t=0.00 12:54:28

. 
. local mc_T_1  .
r; t=0.00 12:54:28

. local mc_p_1  .
r; t=0.00 12:54:28

. local mc_T_2  .
r; t=0.00 12:54:28

. local mc_p_2  .
r; t=0.00 12:54:28

. 
. foreach w in 1 2 {
  2.     di ""
  3.     di "--- Wave `w' ---"
  4.     capture noisily rddensity date if wave_num == `w', c(0)
  5.     if !_rc {
  6.         local mc_T_`w' = e(T_q)
  7.         local mc_p_`w' = e(pv_q)
  8.         di "  T statistic: " %5.3f `mc_T_`w''
  9.         di "  p-value:     " %5.3f `mc_p_`w''
 10.     }
 11. }

--- Wave 1 ---
Computing data-driven bandwidth selectors.

Point estimates and standard errors have been adjusted for repeated observations.
(Use option nomasspoints to suppress this adjustment.)

RD Manipulation test using local polynomial density estimation.

     c =     0.000 | Left of c  Right of c          Number of obs =         4328
-------------------+----------------------          Model         = unrestricted
     Number of obs |      1072        3256          BW method     =         comb
Eff. Number of obs |       448         793          Kernel        =   triangular
    Order est. (p) |         2           2          VCE method    =    jackknife
    Order bias (q) |         3           3
       BW est. (h) |    89.163      85.225

Running variable: date.
------------------------------------------
            Method |      T          P>|T|
-------------------+----------------------
            Robust |    0.9052      0.3654
------------------------------------------

P-values of binomial tests. (H0: prob = .5)
-----------------------------------------------------
 Window Length / 2 |       <c         >=c |     P>|T|
-------------------+----------------------+----------
             4.000 |       20          33 |    0.0984
             8.000 |       52          73 |    0.0732
            12.000 |       74          99 |    0.0677
            16.000 |       85         122 |    0.0122
            20.000 |      100         136 |    0.0225
            24.000 |      115         189 |    0.0000
            28.000 |      121         224 |    0.0000
            32.000 |      125         259 |    0.0000
            36.000 |      139         300 |    0.0000
            40.000 |      203         345 |    0.0000
-----------------------------------------------------
  T statistic: 0.905
  p-value:     0.365

--- Wave 2 ---
Computing data-driven bandwidth selectors.

Point estimates and standard errors have been adjusted for repeated observations.
(Use option nomasspoints to suppress this adjustment.)

RD Manipulation test using local polynomial density estimation.

     c =     0.000 | Left of c  Right of c          Number of obs =         2801
-------------------+----------------------          Model         = unrestricted
     Number of obs |       702        2099          BW method     =         comb
Eff. Number of obs |       296         445          Kernel        =   triangular
    Order est. (p) |         2           2          VCE method    =    jackknife
    Order bias (q) |         3           3
       BW est. (h) |    94.210      80.806

Running variable: date.
------------------------------------------
            Method |      T          P>|T|
-------------------+----------------------
            Robust |    0.6568      0.5113
------------------------------------------

P-values of binomial tests. (H0: prob = .5)
-----------------------------------------------------
 Window Length / 2 |       <c         >=c |     P>|T|
-------------------+----------------------+----------
             7.000 |       29          41 |    0.1882
            14.000 |       55          68 |    0.2792
            21.000 |       73          95 |    0.1049
            28.000 |       90         141 |    0.0010
            35.000 |      101         184 |    0.0000
            42.000 |      142         229 |    0.0000
            49.000 |      166         263 |    0.0000
            56.000 |      195         316 |    0.0000
            63.000 |      226         354 |    0.0000
            70.000 |      247         397 |    0.0000
-----------------------------------------------------
  T statistic: 0.657
  p-value:     0.511
r; t=0.31 12:54:28

. 
. * Density plots — keep rddensity's default plot styling and just export
. foreach w in 1 2 {
  2.     local wave_label = cond(`w' == 1, "Wave 1 (2020)", "Wave 2 (2021)")
  3.     capture noisily rddensity date if wave_num == `w', c(0) plot
  4.     capture graph export "$figs/density_w`w'.png", replace width(1200)
  5. }
Computing data-driven bandwidth selectors.

Point estimates and standard errors have been adjusted for repeated observations.
(Use option nomasspoints to suppress this adjustment.)

RD Manipulation test using local polynomial density estimation.

     c =     0.000 | Left of c  Right of c          Number of obs =         4328
-------------------+----------------------          Model         = unrestricted
     Number of obs |      1072        3256          BW method     =         comb
Eff. Number of obs |       448         793          Kernel        =   triangular
    Order est. (p) |         2           2          VCE method    =    jackknife
    Order bias (q) |         3           3
       BW est. (h) |    89.163      85.225

Running variable: date.
------------------------------------------
            Method |      T          P>|T|
-------------------+----------------------
            Robust |    0.9052      0.3654
------------------------------------------

P-values of binomial tests. (H0: prob = .5)
-----------------------------------------------------
 Window Length / 2 |       <c         >=c |     P>|T|
-------------------+----------------------+----------
             4.000 |       20          33 |    0.0984
             8.000 |       52          73 |    0.0732
            12.000 |       74          99 |    0.0677
            16.000 |       85         122 |    0.0122
            20.000 |      100         136 |    0.0225
            24.000 |      115         189 |    0.0000
            28.000 |      121         224 |    0.0000
            32.000 |      125         259 |    0.0000
            36.000 |      139         300 |    0.0000
            40.000 |      203         345 |    0.0000
-----------------------------------------------------
plotting feature requires command lpdensity, install with
net install lpdensity, from(https://raw.githubusercontent.com/nppackages/lpdensity/main/stata) replace
Computing data-driven bandwidth selectors.

Point estimates and standard errors have been adjusted for repeated observations.
(Use option nomasspoints to suppress this adjustment.)

RD Manipulation test using local polynomial density estimation.

     c =     0.000 | Left of c  Right of c          Number of obs =         2801
-------------------+----------------------          Model         = unrestricted
     Number of obs |       702        2099          BW method     =         comb
Eff. Number of obs |       296         445          Kernel        =   triangular
    Order est. (p) |         2           2          VCE method    =    jackknife
    Order bias (q) |         3           3
       BW est. (h) |    94.210      80.806

Running variable: date.
------------------------------------------
            Method |      T          P>|T|
-------------------+----------------------
            Robust |    0.6568      0.5113
------------------------------------------

P-values of binomial tests. (H0: prob = .5)
-----------------------------------------------------
 Window Length / 2 |       <c         >=c |     P>|T|
-------------------+----------------------+----------
             7.000 |       29          41 |    0.1882
            14.000 |       55          68 |    0.2792
            21.000 |       73          95 |    0.1049
            28.000 |       90         141 |    0.0010
            35.000 |      101         184 |    0.0000
            42.000 |      142         229 |    0.0000
            49.000 |      166         263 |    0.0000
            56.000 |      195         316 |    0.0000
            63.000 |      226         354 |    0.0000
            70.000 |      247         397 |    0.0000
-----------------------------------------------------
plotting feature requires command lpdensity, install with
net install lpdensity, from(https://raw.githubusercontent.com/nppackages/lpdensity/main/stata) replace
r; t=0.15 12:54:28

. 
. /*==============================================================================
>   PART 3: COVARIATE BALANCE — SHARP RD ON EACH PREDETERMINED COVARIATE
> ==============================================================================*/
. 
. di ""

r; t=0.00 12:54:28

. di "=================================================================="
==================================================================
r; t=0.00 12:54:28

. di "  Covariate balance at the cutoff — sharp RD per covariate, by wave"
  Covariate balance at the cutoff — sharp RD per covariate, by wave
r; t=0.00 12:54:28

. di "=================================================================="
==================================================================
r; t=0.00 12:54:28

. 
. local pre_ctrls female age_panel yrseduc time_col jobopp labven         ///
>                 typeworkven1 typeworkven2 typeworkven3 written_cont      ///
>                 smartven owner electven waterven sewageven               ///
>                 hhven_spouse hhven_other healthmig frdfam  ///
>                 child_venez
r; t=0.00 12:54:28

. 
. * Helper to run rdrobust per wave and store results
. capture program drop _balance_one
r; t=0.00 12:54:28

. program define _balance_one, rclass
  1.     args var wave
  2.     local b  = .
  3.     local se = .
  4.     local p  = .
  5.     local n  = .
  6.     capture rdrobust `var' date if wave_num == `wave', c(0)
  7.     if !_rc {
  8.         local b  = e(tau_cl)
  9.         local se = e(se_tau_cl)
 10.         local p  = e(pv_cl)
 11.         local n  = e(N_h_l) + e(N_h_r)
 12.     }
 13.     return scalar b  = `b'
 14.     return scalar se = `se'
 15.     return scalar p  = `p'
 16.     return scalar n  = `n'
 17. end
r; t=0.00 12:54:28

. 
. file open bal using "$out/05_Validity_BalanceLog.txt", write replace text
(file ../outputs/05_Validity_BalanceLog.txt not found)
r; t=0.00 12:54:28

. file write bal "variable" _tab "w1_b" _tab "w1_se" _tab "w1_p" _tab "w1_n" _tab
r; t=0.00 12:54:28

. file write bal "w2_b" _tab "w2_se" _tab "w2_p" _tab "w2_n" _newline
r; t=0.00 12:54:28

. 
. local n_pre : word count `pre_ctrls'
r; t=0.00 12:54:28

. tempname BAL
r; t=0.00 12:54:28

. matrix `BAL' = J(`n_pre', 8, .)
r; t=0.00 12:54:28

. local bal_names ""
r; t=0.00 12:54:28

. 
. local i = 0
r; t=0.00 12:54:28

. foreach v of local pre_ctrls {
  2.     capture confirm variable `v'
  3.     if _rc continue
  4.     local ++i
  5.     local bal_names "`bal_names' `v'"
  6. 
.     _balance_one `v' 1
  7.     local w1b  = r(b)
  8.     local w1se = r(se)
  9.     local w1p  = r(p)
 10.     local w1n  = r(n)
 11. 
.     _balance_one `v' 2
 12.     local w2b  = r(b)
 13.     local w2se = r(se)
 14.     local w2p  = r(p)
 15.     local w2n  = r(n)
 16. 
.     matrix `BAL'[`i', 1] = `w1b'
 17.     matrix `BAL'[`i', 2] = `w1se'
 18.     matrix `BAL'[`i', 3] = `w1p'
 19.     matrix `BAL'[`i', 4] = `w1n'
 20.     matrix `BAL'[`i', 5] = `w2b'
 21.     matrix `BAL'[`i', 6] = `w2se'
 22.     matrix `BAL'[`i', 7] = `w2p'
 23.     matrix `BAL'[`i', 8] = `w2n'
 24. 
.     file write bal "`v'" _tab
 25.     file write bal "`=string(`w1b', "%6.3f")'" _tab "`=string(`w1se', "%6.3f")'" _tab
 26.     file write bal "`=string(`w1p', "%6.3f")'" _tab "`w1n'" _tab
 27.     file write bal "`=string(`w2b', "%6.3f")'" _tab "`=string(`w2se', "%6.3f")'" _tab
 28.     file write bal "`=string(`w2p', "%6.3f")'" _tab "`w2n'" _newline
 29. 
.     local star1 = ""
 30.     if `w1p' < 0.10 local star1 "+"
 31.     if `w1p' < 0.05 local star1 "*"
 32.     if `w1p' < 0.01 local star1 "**"
 33.     local star2 = ""
 34.     if `w2p' < 0.10 local star2 "+"
 35.     if `w2p' < 0.05 local star2 "*"
 36.     if `w2p' < 0.01 local star2 "**"
 37.     di %-22s "`v'" %10.3f `w1b' %10.3f `w1se' %10.3f `w1p' " `star1'  " ///
>        %10.3f `w2b' %10.3f `w2se' %10.3f `w2p' " `star2'"
 38. }
female                     0.011     0.075     0.881       -0.026     0.086     0.764 
age_panel                 -1.092     1.785     0.541       -0.560     2.164     0.796 
yrseduc                    1.254     0.399     0.002 **       1.827     0.405     0.000 **
time_col                  -0.732     1.017     0.471       -1.632     1.244     0.190 
jobopp                    -0.107     0.064     0.095 +      -0.089     0.084     0.286 
labven                     0.015     0.018     0.396        0.023     0.032     0.463 
typeworkven1              -0.055     0.071     0.440        0.183     0.107     0.088 +
typeworkven2               0.109     0.052     0.037 *       0.087     0.060     0.149 
typeworkven3              -0.071     0.067     0.289       -0.080     0.074     0.280 
written_cont               0.018     0.068     0.797        0.100     0.088     0.252 
smartven                   0.085     0.078     0.276        0.064     0.077     0.411 
owner                     -0.058     0.054     0.283       -0.044     0.078     0.574 
electven                   0.000     0.000         .       -0.005     0.003     0.083 +
waterven                   0.062     0.050     0.219        0.080     0.059     0.173 
sewageven                  0.060     0.044     0.174        0.115     0.053     0.031 *
hhven_spouse               0.088     0.065     0.179        0.048     0.093     0.603 
hhven_other                0.028     0.041     0.495        0.009     0.048     0.843 
healthmig                 -0.015     0.061     0.810        0.011     0.071     0.875 
frdfam                     0.053     0.063     0.403       -0.013     0.082     0.878 
child_venez               -0.304     0.170     0.074 +      -0.329     0.246     0.182 
r; t=9.59 12:54:38

. file close bal
r; t=0.00 12:54:38

. 
. * Truncate matrix to actual rows used
. matrix `BAL' = `BAL'[1..`i', 1...]
r; t=0.00 12:54:38

. local n_bal = `i'
r; t=0.00 12:54:38

. 
. * Count rejections per wave at p<0.05
. local rej_w1 = 0
r; t=0.00 12:54:38

. local rej_w2 = 0
r; t=0.00 12:54:38

. forvalues j = 1/`n_bal' {
  2.     if `BAL'[`j', 3] < 0.05 & `BAL'[`j', 3] != . local ++rej_w1
  3.     if `BAL'[`j', 7] < 0.05 & `BAL'[`j', 7] != . local ++rej_w2
  4. }
r; t=0.00 12:54:38

. local exp_rej = round(`n_bal' * 0.05, 0.1)
r; t=0.00 12:54:38

. 
. di ""

r; t=0.00 12:54:38

. di "  Rejections at p<0.05:"
  Rejections at p<0.05:
r; t=0.00 12:54:38

. di "    Wave 1: `rej_w1' of `n_bal' (chance: ~`exp_rej')"
    Wave 1: 2 of 20 (chance: ~1)
r; t=0.00 12:54:38

. di "    Wave 2: `rej_w2' of `n_bal' (chance: ~`exp_rej')"
    Wave 2: 2 of 20 (chance: ~1)
r; t=0.00 12:54:38

. 
. /*==============================================================================
>   PART 3b: BALANCE COEFFICIENT PLOT — standardized estimates, W1 vs W2
> ==============================================================================*/
. 
. di ""

r; t=0.00 12:54:38

. di "--- Building balance coefficient plot (standardized estimates) ---"
--- Building balance coefficient plot (standardized estimates) ---
r; t=0.00 12:54:38

. 
. * Standardize each covariate using the full analysis-sample SD so coefficients
. * are in SD units and comparable across binary, continuous, and Likert vars.
. foreach v of local pre_ctrls {
  2.     capture confirm variable `v'
  3.     if _rc continue
  4.     capture drop std_`v'
  5.     qui sum `v'
  6.     if r(sd) > 0 gen std_`v' = (`v' - r(mean)) / r(sd)
  7. }
(103 missing values generated)
(177 missing values generated)
(580 missing values generated)
(580 missing values generated)
(580 missing values generated)
(580 missing values generated)
r; t=0.05 12:54:38

. 
. * Re-run sharp RD on the standardized versions and store results
. tempname BSTD
r; t=0.00 12:54:38

. matrix `BSTD' = J(`n_pre', 8, .)
r; t=0.00 12:54:38

. local i = 0
r; t=0.00 12:54:38

. local bstd_names ""
r; t=0.00 12:54:38

. foreach v of local pre_ctrls {
  2.     capture confirm variable std_`v'
  3.     if _rc continue
  4.     local ++i
  5.     local bstd_names "`bstd_names' `v'"
  6. 
.     capture rdrobust std_`v' date if wave_num == 1, c(0)
  7.     if !_rc {
  8.         matrix `BSTD'[`i', 1] = e(tau_cl)
  9.         matrix `BSTD'[`i', 2] = e(se_tau_cl)
 10.         matrix `BSTD'[`i', 3] = e(tau_cl) - 1.96*e(se_tau_cl)
 11.         matrix `BSTD'[`i', 4] = e(tau_cl) + 1.96*e(se_tau_cl)
 12.     }
 13.     capture rdrobust std_`v' date if wave_num == 2, c(0)
 14.     if !_rc {
 15.         matrix `BSTD'[`i', 5] = e(tau_cl)
 16.         matrix `BSTD'[`i', 6] = e(se_tau_cl)
 17.         matrix `BSTD'[`i', 7] = e(tau_cl) - 1.96*e(se_tau_cl)
 18.         matrix `BSTD'[`i', 8] = e(tau_cl) + 1.96*e(se_tau_cl)
 19.     }
 20. }
r; t=9.94 12:54:48

. matrix `BSTD' = `BSTD'[1..`i', 1...]
r; t=0.00 12:54:48

. local n_bstd = `i'
r; t=0.00 12:54:48

. 
. * Build a small dataset for the plot
. preserve
r; t=0.03 12:54:48

. clear
r; t=0.00 12:54:48

. set obs `n_bstd'
Number of observations (_N) was 0, now 20.
r; t=0.00 12:54:48

. gen str30 var = ""
(20 missing values generated)
r; t=0.00 12:54:48

. gen yorder = _n
r; t=0.00 12:54:48

. gen w1_b  = .
(20 missing values generated)
r; t=0.00 12:54:48

. gen w1_lb = .
(20 missing values generated)
r; t=0.00 12:54:48

. gen w1_ub = .
(20 missing values generated)
r; t=0.00 12:54:48

. gen w2_b  = .
(20 missing values generated)
r; t=0.00 12:54:48

. gen w2_lb = .
(20 missing values generated)
r; t=0.00 12:54:48

. gen w2_ub = .
(20 missing values generated)
r; t=0.00 12:54:48

. forvalues r = 1/`n_bstd' {
  2.     local nm : word `r' of `bstd_names'
  3.     replace var = "`nm'"        in `r'
  4.     replace w1_b   = `BSTD'[`r', 1] in `r'
  5.     replace w1_lb  = `BSTD'[`r', 3] in `r'
  6.     replace w1_ub  = `BSTD'[`r', 4] in `r'
  7.     replace w2_b   = `BSTD'[`r', 5] in `r'
  8.     replace w2_lb  = `BSTD'[`r', 7] in `r'
  9.     replace w2_ub  = `BSTD'[`r', 8] in `r'
 10. }
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
r; t=0.00 12:54:48

. 
. * Reverse y order so first variable is at top
. qui sum yorder
r; t=0.00 12:54:48

. local maxy = r(max)
r; t=0.00 12:54:48

. gen yrev = `maxy' - yorder + 1
r; t=0.00 12:54:48

. 
. * Two markers per variable (W1 slightly above, W2 slightly below)
. gen w1_y = yrev + 0.2
r; t=0.00 12:54:48

. gen w2_y = yrev - 0.2
r; t=0.00 12:54:48

. 
. * Build a coefficient plot using polished labels
. local ylabel ""
r; t=0.00 12:54:48

. forvalues r = 1/`n_bstd' {
  2.     local nm     = var[`r']
  3.     local pos    = `n_bstd' - `r' + 1
  4.     local pretty "`lbl_`nm''"
  5.     if "`pretty'" == "" local pretty "`nm'"
  6.     local ylabel `"`ylabel' `pos' "`pretty'""'
  7. }
r; t=0.00 12:54:48

. 
. twoway ///
>     (rcap w1_lb w1_ub w1_y if !missing(w1_b), horizontal lcolor(navy)      lwidth(medthin)) ///
>     (scatter w1_y w1_b if !missing(w1_b), msymbol(O) mcolor(navy)      mfcolor(white)     msize(medlarge)) ///
>     (rcap w2_lb w2_ub w2_y if !missing(w2_b), horizontal lcolor(cranberry) lwidth(medthin)) ///
>     (scatter w2_y w2_b if !missing(w2_b), msymbol(S) mcolor(cranberry) mfcolor(cranberry) msize(medlarge)) ///
>     , xline(0, lcolor(gs8) lpattern(solid) lwidth(thin)) ///
>       ylabel(`ylabel', labsize(small) angle(0) nogrid notick) ///
>       yscale(noline) ///
>       xlabel(, labsize(small) nogrid notick) ///
>       xscale(noline) ///
>       ytitle("") ///
>       xtitle("Sharp RD coefficient at the cutoff (SD units)", size(small) margin(small)) ///
>       legend(order(2 "Wave 1 (2020)" 4 "Wave 2 (2021)") rows(1) position(6) ///
>              region(fcolor(white) lcolor(black) lwidth(thin)) size(small)) ///
>       title("Covariate balance at the RAMV cutoff", size(medium) color(black)) ///
>       note("Notes: Each row is a sharp RD on a predetermined characteristic measured at the time of arrival" ///
>            "in Colombia. Markers are point estimates from rdrobust (MSE-optimal bw, triangular kernel);" ///
>            "horizontal bars are 95% CIs (conventional). All variables are standardized to mean 0 / SD 1" ///
>            "within the JEEA analysis sample, so the coefficient is the jump at the cutoff in SD units." ///
>            "CIs that cover zero indicate the covariate is balanced. '[=1]' denotes binary indicators.", ///
>            size(vsmall) color(black) span) ///
>       graphregion(color(white) margin(small)) ///
>       plotregion(fcolor(white) lcolor(black) lwidth(thin) margin(small)) ///
>       bgcolor(white) ///
>       ysize(7) xsize(8) ///
>       name(balance_plot, replace)
r; t=1.93 12:54:50

. 
. graph export "$figs/balance_coefplot.png", replace width(1200)
(file ../outputs/figures_validity/balance_coefplot.png not found)
file ../outputs/figures_validity/balance_coefplot.png saved as PNG format
r; t=0.19 12:54:50

. restore
r; t=0.01 12:54:50

. 
. di "  Coefficient plot saved: $figs/balance_coefplot.png"
  Coefficient plot saved: ../outputs/figures_validity/balance_coefplot.png
r; t=0.00 12:54:50

. 
. /*==============================================================================
>   PART 4: JOINT BALANCE TEST
> ==============================================================================*/
. 
. di ""

r; t=0.00 12:54:50

. di "=================================================================="
==================================================================
r; t=0.00 12:54:50

. di "  Joint balance test — F-test of treatment on all covariates"
  Joint balance test — F-test of treatment on all covariates
r; t=0.00 12:54:50

. di "=================================================================="
==================================================================
r; t=0.00 12:54:50

. 
. * Strategy: regress trt_hh on all predetermined covariates plus running
. * variable * eligibility dummy in a narrow bandwidth. Joint test of the
. * covariates' coefficients = no balance failure.
. * Simpler: regress eligibility dummy (date >= 0) on covariates within
. * the optimal-bandwidth window and report joint F.
. 
. gen rd_above = (date >= 0) if !missing(date)
r; t=0.00 12:54:50

. 
. local jt_F_1   .
r; t=0.00 12:54:50

. local jt_p_1   .
r; t=0.00 12:54:50

. local jt_n_1   .
r; t=0.00 12:54:50

. local jt_F_2   .
r; t=0.00 12:54:50

. local jt_p_2   .
r; t=0.00 12:54:50

. local jt_n_2   .
r; t=0.00 12:54:50

. 
. foreach w in 1 2 {
  2.     di ""
  3.     di "--- Wave `w' ---"
  4.     capture noisily reg rd_above `pre_ctrls' if wave_num == `w'
  5.     if !_rc {
  6.         local jt_F_`w' = e(F)
  7.         local jt_p_`w' = Ftail(e(df_m), e(df_r), e(F))
  8.         local jt_n_`w' = e(N)
  9.         di "  F = " %6.3f `jt_F_`w'' "  p = " %6.3f `jt_p_`w'' "  N = `jt_n_`w''"
 10.     }
 11. }

--- Wave 1 ---

      Source |       SS           df       MS      Number of obs   =     3,877
-------------+----------------------------------   F(20, 3856)     =     26.67
       Model |  87.0965302        20  4.35482651   Prob > F        =    0.0000
    Residual |  629.610202     3,856  .163280654   R-squared       =    0.1215
-------------+----------------------------------   Adj R-squared   =    0.1170
       Total |  716.706732     3,876  .184908858   Root MSE        =    .40408

------------------------------------------------------------------------------
    rd_above | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
      female |   .0123027   .0135372     0.91   0.364     -.014238    .0388434
   age_panel |   .0044999   .0006834     6.58   0.000     .0031601    .0058397
     yrseduc |   .0091093   .0024097     3.78   0.000     .0043849    .0138337
    time_col |   .0094509   .0004807    19.66   0.000     .0085085    .0103933
      jobopp |  -.0121551    .013703    -0.89   0.375    -.0390209    .0147108
      labven |  -.0179292   .0513294    -0.35   0.727    -.1185646    .0827062
typeworkven1 |  -.0432427   .0310652    -1.39   0.164    -.1041485    .0176631
typeworkven2 |  -.0896848   .0349578    -2.57   0.010    -.1582222   -.0211473
typeworkven3 |  -.0424399   .0332645    -1.28   0.202    -.1076576    .0227778
written_cont |   .0275615   .0152041     1.81   0.070    -.0022474    .0573704
    smartven |   .0483356   .0133809     3.61   0.000     .0221013      .07457
       owner |   .0021663   .0190743     0.11   0.910    -.0352303    .0395629
    electven |  -.1138754   .0837536    -1.36   0.174    -.2780809    .0503302
    waterven |   .0078642   .0206723     0.38   0.704    -.0326655    .0483939
   sewageven |   .0306955   .0288438     1.06   0.287    -.0258551    .0872461
hhven_spouse |  -.0071026   .0139344    -0.51   0.610     -.034422    .0202169
 hhven_other |  -.0743981   .0218894    -3.40   0.001     -.117314   -.0314822
   healthmig |   .0493665   .0216302     2.28   0.023     .0069588    .0917743
      frdfam |  -.0364938   .0146817    -2.49   0.013    -.0652784   -.0077091
 child_venez |  -.0160843   .0047339    -3.40   0.001    -.0253655   -.0068031
       _cons |   .1532217    .104312     1.47   0.142    -.0512903    .3577336
------------------------------------------------------------------------------
  F = 26.671  p =  0.000  N = 3877

--- Wave 2 ---

      Source |       SS           df       MS      Number of obs   =     2,464
-------------+----------------------------------   F(20, 2443)     =     17.62
       Model |  57.4804856        20  2.87402428   Prob > F        =    0.0000
    Residual |  398.461073     2,443  .163103182   R-squared       =    0.1261
-------------+----------------------------------   Adj R-squared   =    0.1189
       Total |  455.941558     2,463  .185116345   Root MSE        =    .40386

------------------------------------------------------------------------------
    rd_above | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
      female |   .0099507   .0169393     0.59   0.557    -.0232661    .0431676
   age_panel |   .0058436   .0008522     6.86   0.000     .0041724    .0075148
     yrseduc |   .0087918   .0031139     2.82   0.005     .0026856     .014898
    time_col |   .0077259   .0005404    14.30   0.000     .0066662    .0087856
      jobopp |   -.012903   .0170733    -0.76   0.450    -.0463827    .0205766
      labven |  -.0454305   .0682265    -0.67   0.506    -.1792182    .0883572
typeworkven1 |  -.0113339   .0397021    -0.29   0.775    -.0891872    .0665194
typeworkven2 |  -.0591723    .044552    -1.33   0.184    -.1465359    .0281914
typeworkven3 |  -.0297304   .0416981    -0.71   0.476    -.1114977    .0520368
written_cont |    .020325    .019348     1.05   0.294    -.0176152    .0582652
    smartven |   .0610037   .0167749     3.64   0.000     .0281093    .0938981
       owner |  -.0015751   .0240958    -0.07   0.948    -.0488254    .0456751
    electven |  -.0484098   .1071613    -0.45   0.651    -.2585462    .1617267
    waterven |   .0167309   .0253802     0.66   0.510    -.0330381    .0664999
   sewageven |   .0496834   .0365968     1.36   0.175    -.0220805    .1214473
hhven_spouse |  -.0067651   .0174525    -0.39   0.698    -.0409883    .0274581
 hhven_other |  -.1183346   .0274163    -4.32   0.000    -.1720962    -.064573
   healthmig |   .0434084   .0276375     1.57   0.116    -.0107869    .0976038
      frdfam |  -.0652443   .0186454    -3.50   0.000    -.1018068   -.0286818
 child_venez |  -.0186097    .006126    -3.04   0.002    -.0306224   -.0065969
       _cons |   .1319055   .1343566     0.98   0.326    -.1315592    .3953702
------------------------------------------------------------------------------
  F = 17.621  p =  0.000  N = 2464
r; t=3.56 12:54:54

. 
. /*==============================================================================
>   PART 5: PDF REPORT
> ==============================================================================*/
. 
. di ""

r; t=0.00 12:54:54

. di "--- Building PDF report ---"
--- Building PDF report ---
r; t=0.00 12:54:54

. 
. putpdf clear
r; t=0.05 12:54:54

. putpdf begin, pagesize(letter) margin(left, 0.8in) margin(right, 0.8in)
r; t=0.04 12:54:54

. 
. putpdf paragraph, halign(center)
r; t=0.02 12:54:54

. putpdf text ("Local-Continuity Validity Tests"), bold font(, 16)
r; t=0.02 12:54:54

. putpdf paragraph, halign(center)
r; t=0.01 12:54:54

. putpdf text ("PEP-RAMV RD design — Wave 1 (2020) and Wave 2 (2021)"), italic font(, 12)
r; t=0.00 12:54:54

. putpdf paragraph, halign(center)
r; t=0.03 12:54:54

. putpdf text ("Generated $S_DATE."), italic
r; t=0.00 12:54:54

. 
. putpdf paragraph
r; t=0.00 12:54:54

. putpdf text ("Overview. "), bold
r; t=0.00 12:54:54

. putpdf text ("This appendix tests the two main identifying assumptions of the RD design at the RAMV deadline (June
>  8, 2018): no manipulation of the running variable and continuity of pre-treatment characteristics. The running va
> riable is reflected days from the deadline; eligible (PEP-eligible) households are those whose first member arrive
> d strictly before the deadline. The sample is restricted to JEEA's analysis sample (orden in {1,2}, sample_reg=1).
> ")
r; t=0.00 12:54:54

. 
. * Section 1: McCrary
. putpdf paragraph
r; t=0.00 12:54:54

. putpdf text ("1. McCrary density test"), bold font(, 14)
r; t=0.00 12:54:54

. putpdf paragraph
r; t=0.00 12:54:54

. putpdf text ("Tests for endogenous sorting (manipulation) of the running variable at the cutoff. Under valid ident
> ification the density of arrival dates is continuous at the deadline (large p-value = no manipulation)."), italic 
> font(, 10)
r; t=0.00 12:54:54

. 
. putpdf table mc = (3, 4), border(all)
r; t=0.02 12:54:54

. putpdf table mc(1,1) = ("Wave"), bold halign(center)
r; t=0.01 12:54:54

. putpdf table mc(1,2) = ("T statistic"), bold halign(center)
r; t=0.00 12:54:54

. putpdf table mc(1,3) = ("p-value"), bold halign(center)
r; t=0.00 12:54:54

. putpdf table mc(1,4) = ("Verdict"), bold halign(center)
r; t=0.00 12:54:54

. putpdf table mc(2,1) = ("Wave 1 (2020)")
r; t=0.00 12:54:54

. putpdf table mc(2,2) = ("`=string(`mc_T_1', "%6.3f")'")
r; t=0.01 12:54:54

. putpdf table mc(2,3) = ("`=string(`mc_p_1', "%6.3f")'")
r; t=0.00 12:54:54

. local v1 = cond(`mc_p_1' > 0.10, "PASS", cond(`mc_p_1' > 0.05, "marginal", "FAIL"))
r; t=0.00 12:54:54

. putpdf table mc(2,4) = ("`v1'")
r; t=0.00 12:54:54

. putpdf table mc(3,1) = ("Wave 2 (2021)")
r; t=0.00 12:54:54

. putpdf table mc(3,2) = ("`=string(`mc_T_2', "%6.3f")'")
r; t=0.00 12:54:54

. putpdf table mc(3,3) = ("`=string(`mc_p_2', "%6.3f")'")
r; t=0.00 12:54:54

. local v2 = cond(`mc_p_2' > 0.10, "PASS", cond(`mc_p_2' > 0.05, "marginal", "FAIL"))
r; t=0.00 12:54:54

. putpdf table mc(3,4) = ("`v2'")
r; t=0.00 12:54:54

. 
. putpdf paragraph
r; t=0.01 12:54:54

. putpdf text ("Notes: 'PASS' = p>0.10 (no evidence of manipulation); 'marginal' = 0.05<p<0.10; 'FAIL' = p<0.05. Est
> imated using rddensity with the local-quadratic, jackknife-variance defaults."), italic font(, 9)
r; t=0.00 12:54:54

. 
. * Section 2: Covariate balance
. putpdf paragraph
r; t=0.00 12:54:54

. putpdf text ("2. Covariate balance at the cutoff"), bold font(, 14)
r; t=0.00 12:54:54

. putpdf paragraph
r; t=0.00 12:54:54

. putpdf text ("Sharp RD on each predetermined characteristic, separately by wave. Under continuity of potential out
> comes none should jump significantly. The covariates are JEEA's full pre-migration set: demographics (age, sex, ed
> ucation, time in Colombia, child born in VZ), pre-migration economic conditions (job offer in CO, work in VZ, occu
> pation type, written contract, days worked, smartphone, homeownership, utilities), and family/migration network (p
> arents/spouse/other HH born in VZ, healthy at migration, friends/family in CO)."), italic font(, 10)
r; t=0.00 12:54:54

. 
. local n_rows = `n_bal' + 2
r; t=0.00 12:54:54

. putpdf table bb = (`n_rows', 7), border(all)
r; t=0.00 12:54:54

. putpdf table bb(1,1) = ("Variable"), bold halign(center)
r; t=0.00 12:54:54

. putpdf table bb(1,2) = ("W1 coef"), bold halign(center)
r; t=0.00 12:54:54

. putpdf table bb(1,3) = ("W1 SE"), bold halign(center)
r; t=0.00 12:54:54

. putpdf table bb(1,4) = ("W1 p"), bold halign(center)
r; t=0.00 12:54:54

. putpdf table bb(1,5) = ("W2 coef"), bold halign(center)
r; t=0.00 12:54:54

. putpdf table bb(1,6) = ("W2 SE"), bold halign(center)
r; t=0.00 12:54:54

. putpdf table bb(1,7) = ("W2 p"), bold halign(center)
r; t=0.00 12:54:54

. forvalues r = 1/`n_bal' {
  2.     local nm : word `r' of `bal_names'
  3.     local pretty "`lbl_`nm''"
  4.     if "`pretty'" == "" local pretty "`nm'"
  5.     local row = `r' + 1
  6.     local b1 = `BAL'[`r', 1]
  7.     local s1 = `BAL'[`r', 2]
  8.     local p1 = `BAL'[`r', 3]
  9.     local b2 = `BAL'[`r', 5]
 10.     local s2 = `BAL'[`r', 6]
 11.     local p2 = `BAL'[`r', 7]
 12.     local star1 = ""
 13.     if `p1' < 0.10 local star1 "+"
 14.     if `p1' < 0.05 local star1 "*"
 15.     if `p1' < 0.01 local star1 "**"
 16.     local star2 = ""
 17.     if `p2' < 0.10 local star2 "+"
 18.     if `p2' < 0.05 local star2 "*"
 19.     if `p2' < 0.01 local star2 "**"
 20.     putpdf table bb(`row',1) = ("`pretty'"), font(, 9)
 21.     putpdf table bb(`row',2) = ("`=string(`b1', "%6.3f")'`star1'"), halign(center) font(, 9)
 22.     putpdf table bb(`row',3) = ("`=string(`s1', "%6.3f")'"),         halign(center) font(, 9)
 23.     putpdf table bb(`row',4) = ("`=string(`p1', "%6.3f")'"),         halign(center) font(, 9)
 24.     putpdf table bb(`row',5) = ("`=string(`b2', "%6.3f")'`star2'"), halign(center) font(, 9)
 25.     putpdf table bb(`row',6) = ("`=string(`s2', "%6.3f")'"),         halign(center) font(, 9)
 26.     putpdf table bb(`row',7) = ("`=string(`p2', "%6.3f")'"),         halign(center) font(, 9)
 27. }
r; t=0.09 12:54:54

. putpdf table bb(`n_rows',1) = ("Notes: + p<0.10, * p<0.05, ** p<0.01. Sharp rdrobust at MSE-optimal bw, triangular
>  kernel."), italic font(, 8)
r; t=0.00 12:54:54

. 
. * Summary row
. putpdf paragraph
r; t=0.00 12:54:54

. putpdf text ("Rejections at p<0.05: W1 = `rej_w1' / `n_bal'   W2 = `rej_w2' / `n_bal'   (chance ≈ `exp_rej')"), bo
> ld font(, 11)
r; t=0.00 12:54:54

. 
. * Coefficient plot
. putpdf paragraph
r; t=0.00 12:54:54

. putpdf text ("2b. Balance coefficient plot (standardized)"), bold font(, 14)
r; t=0.00 12:54:54

. putpdf paragraph
r; t=0.00 12:54:54

. putpdf text ("Sharp-RD jump at the cutoff for each predetermined covariate, expressed in within-sample standard-de
> viation units. Hollow circles are Wave-1 (2018) estimates and filled squares are Wave-2 (2022) estimates; horizont
> al bars are 95% CIs (conventional rdrobust SE). A confidence interval that covers the dashed zero line indicates t
> he covariate is balanced at the cutoff."), italic font(, 10)
r; t=0.00 12:54:54

. capture confirm file "$figs/balance_coefplot.png"
r; t=0.00 12:54:54

. if !_rc {
.     putpdf paragraph, halign(center)
r; t=0.00 12:54:54
.     putpdf image "$figs/balance_coefplot.png", width(6.5)
r; t=0.01 12:54:54
. }
r; t=0.01 12:54:54

. 
. * Save part 1
. putpdf save "$out/05_Validity_part1.pdf", replace
successfully created "C:/Users/wb614536/Downloads/replication/replication/outputs/05_Validity_part1.pdf"
r; t=0.06 12:54:54

. 
. * Section 3: Joint test (separate PDF to avoid putpdf table-count limits)
. putpdf clear
r; t=0.00 12:54:54

. putpdf begin, pagesize(letter) margin(left, 0.8in) margin(right, 0.8in)
r; t=0.00 12:54:54

. putpdf paragraph, halign(center)
r; t=0.00 12:54:54

. putpdf text ("Local-Continuity Validity Tests — Part 2"), bold font(, 14)
r; t=0.00 12:54:54

. 
. putpdf paragraph
r; t=0.03 12:54:54

. putpdf text ("3. Joint balance test"), bold font(, 14)
r; t=0.00 12:54:54

. putpdf paragraph
r; t=0.00 12:54:54

. putpdf text ("F-test from regressing the eligibility indicator (date >= 0, after reflection) on all predetermined 
> covariates within the JEEA analysis sample. Under valid identification the joint F should be small and the p-value
>  large (p>0.10 = PASS)."), italic font(, 10)
r; t=0.00 12:54:54

. 
. putpdf table jt = (3, 5), border(all)
r; t=0.00 12:54:54

. putpdf table jt(1,1) = ("Wave"), bold halign(center)
r; t=0.00 12:54:54

. putpdf table jt(1,2) = ("F"), bold halign(center)
r; t=0.00 12:54:54

. putpdf table jt(1,3) = ("p"), bold halign(center)
r; t=0.00 12:54:54

. putpdf table jt(1,4) = ("N"), bold halign(center)
r; t=0.00 12:54:54

. putpdf table jt(1,5) = ("Verdict"), bold halign(center)
r; t=0.00 12:54:54

. putpdf table jt(2,1) = ("Wave 1 (2020)")
r; t=0.00 12:54:54

. putpdf table jt(2,2) = ("`=string(`jt_F_1', "%6.3f")'")
r; t=0.00 12:54:54

. putpdf table jt(2,3) = ("`=string(`jt_p_1', "%6.3f")'")
r; t=0.00 12:54:54

. putpdf table jt(2,4) = ("`jt_n_1'")
r; t=0.00 12:54:54

. local v1j = cond(`jt_p_1' > 0.10, "PASS", cond(`jt_p_1' > 0.05, "marginal", "FAIL"))
r; t=0.00 12:54:54

. putpdf table jt(2,5) = ("`v1j'")
r; t=0.00 12:54:54

. putpdf table jt(3,1) = ("Wave 2 (2021)")
r; t=0.00 12:54:54

. putpdf table jt(3,2) = ("`=string(`jt_F_2', "%6.3f")'")
r; t=0.00 12:54:54

. putpdf table jt(3,3) = ("`=string(`jt_p_2', "%6.3f")'")
r; t=0.00 12:54:54

. putpdf table jt(3,4) = ("`jt_n_2'")
r; t=0.00 12:54:54

. local v2j = cond(`jt_p_2' > 0.10, "PASS", cond(`jt_p_2' > 0.05, "marginal", "FAIL"))
r; t=0.00 12:54:54

. putpdf table jt(3,5) = ("`v2j'")
r; t=0.00 12:54:54

. 
. * Density plots
. putpdf paragraph
r; t=0.00 12:54:54

. putpdf text ("4. Visual evidence — running-variable density"), bold font(, 14)
r; t=0.00 12:54:54

. putpdf paragraph
r; t=0.00 12:54:54

. putpdf text ("Histograms of the running variable (reflected days from the RAMV deadline) by wave, with the local-p
> olynomial density estimate superimposed. A discontinuity at the cutoff would suggest manipulation."), italic font(
> , 10)
r; t=0.00 12:54:54

. foreach w in 1 2 {
  2.     capture confirm file "$figs/density_w`w'.png"
  3.     if !_rc {
  4.         putpdf paragraph, halign(center)
  5.         putpdf image "$figs/density_w`w'.png", width(5)
  6.     }
  7. }
r; t=0.00 12:54:54

. 
. putpdf save "$out/05_Validity_part2.pdf", replace
successfully created "C:/Users/wb614536/Downloads/replication/replication/outputs/05_Validity_part2.pdf"
r; t=0.02 12:54:54

. 
. * Combined headline file
. copy "$out/05_Validity_part1.pdf" "$out/05_Validity.pdf", replace
(file ../outputs/05_Validity.pdf not found)
r; t=0.01 12:54:54

. 
. * LaTeX skeleton
. file open tex using "$out/05_Validity.tex", write replace
(file ../outputs/05_Validity.tex not found)
r; t=0.00 12:54:54

. file write tex "\documentclass[11pt]{article}\usepackage[margin=1in]{geometry}\usepackage{booktabs}" _n
r; t=0.00 12:54:54

. file write tex "\title{Local-Continuity Validity Tests}\author{Sandra Rozo}\date{\today}\begin{document}\maketitle
> " _n
r; t=0.00 12:54:54

. file write tex "\section{McCrary density}" _n
r; t=0.00 12:54:54

. file write tex "\begin{tabular}{lrr}\toprule" _n
r; t=0.00 12:54:54

. file write tex "Wave & T & p \\\midrule" _n
r; t=0.00 12:54:54

. file write tex "W1 & " %5.3f (`mc_T_1') " & " %5.3f (`mc_p_1') " \\" _n
r; t=0.00 12:54:54

. file write tex "W2 & " %5.3f (`mc_T_2') " & " %5.3f (`mc_p_2') " \\\bottomrule\end{tabular}" _n
r; t=0.00 12:54:54

. file write tex "\section{Joint balance F-test}" _n
r; t=0.00 12:54:54

. file write tex "\begin{tabular}{lrr}\toprule" _n
r; t=0.00 12:54:54

. file write tex "Wave & F & p \\\midrule" _n
r; t=0.00 12:54:54

. file write tex "W1 & " %5.3f (`jt_F_1') " & " %5.3f (`jt_p_1') " \\" _n
r; t=0.00 12:54:54

. file write tex "W2 & " %5.3f (`jt_F_2') " & " %5.3f (`jt_p_2') " \\\bottomrule\end{tabular}" _n
r; t=0.00 12:54:54

. file write tex "\end{document}" _n
r; t=0.00 12:54:54

. file close tex
r; t=0.00 12:54:54

. 
. di ""

r; t=0.00 12:54:54

. di "  PDF saved:    $out/05_Validity.pdf"
  PDF saved:    ../outputs/05_Validity.pdf
r; t=0.00 12:54:54

. di "                $out/05_Validity_part2.pdf"
                ../outputs/05_Validity_part2.pdf
r; t=0.00 12:54:54

. di "  TeX saved:    $out/05_Validity.tex"
  TeX saved:    ../outputs/05_Validity.tex
r; t=0.00 12:54:54

. di "  Balance log:  $out/05_Validity_BalanceLog.txt"
  Balance log:  ../outputs/05_Validity_BalanceLog.txt
r; t=0.00 12:54:54

. di "  Density:      $figs/density_w*.png"
  Density:      ../outputs/figures_validity/density_w*.png
r; t=0.00 12:54:54

. di "  Done."
  Done.
r; t=0.00 12:54:54

. 
. log close
      name:  <unnamed>
       log:  C:\Users\wb614536\Downloads\replication\replication\code\../outputs/05_Validity_log.txt
  log type:  text
 closed on:  25 Jun 2026, 12:54:54
--------------------------------------------------------------------------------------------------------------------
